package com.yeebo.utils;

/**
 * ID工具类处理工具
 */
public class IdUtils {
    public static String generateUserToken(Long userId) {
        String prepareStr = String.valueOf(userId + System.currentTimeMillis());
        return MD5Utils.MD5Encode(prepareStr, "UTF-8", true);
    }

    public static String generateCouponBatchNo() {
        return "NO." + getCurrentFileName();
    }

    public static String getCurrentFileName() {
        String timestamp = DateUtils.getYMDHMSS();
        int randomSuffix = RandomUtils.generateRandomNum(0, 9);
        return timestamp + randomSuffix;
    }

}
